package bloodfang.server;

import java.io.IOException;
import java.net.ServerSocket;

import org.json.JSONException;

public class Server {
	public static void main(String[] args) throws IOException, JSONException {
		boolean listening = true;
        ServerSocket serverSocket = null;
        try {
            serverSocket = new ServerSocket(4444);
        } catch (IOException e) {
            System.err.println("Could not listen on port: 4444.");
            System.exit(1);
        }
        if(serverSocket.isBound())
        	System.out.println("Server running on port: 4444.");
       
		while (listening)
            new BloodfangServerThread(serverSocket.accept()).start();
		
        serverSocket.close();
    }
}
